package br.com.scriptmanager.rest;

import java.util.List;

import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;

import br.com.scriptmanager.rest.json.ScriptJSON;
import br.com.scriptmanager.rest.json.ScriptListaParams;
import br.com.scriptmanager.rest.json.ScriptListaReturn;
import br.com.scriptmanager.services.bso.Script;
import br.com.scriptmanager.services.dbo.ScriptsFindAll;

@Path("/scripts")
public class Scripts {

	@POST
	@Path("/lista")
	public ScriptListaReturn lista(ScriptListaParams filtro){
		ScriptListaReturn result = new ScriptListaReturn();
		Script s = new Script();
		ScriptsFindAll sc = s.findScript(filtro.getIdTipoScript(), filtro.getDemanda());
		result.setScript(sc);
		return result;
	}

	public void tipoScript(){

	}

	public void bancosDados(){
		
	}

	public void findById(Long id){

	}

	public void del(Long id){

	}

	public void dataAtual(){

	}
	
	@POST
	@Produces(MediaType.APPLICATION_JSON)
	@Consumes(MediaType.APPLICATION_JSON)
	public ScriptJSON  salvar(ScriptJSON scriptJSON){
		scriptJSON.setName("fabricio alves");
		return scriptJSON;
	}
	
	@GET
	@Produces(MediaType.APPLICATION_JSON)
	public ScriptJSON get() {
		ScriptJSON scriptJSON = new ScriptJSON();
		scriptJSON.setId(1L);
		scriptJSON.setName("Fabricio alves");
		return scriptJSON;
 
	}
}
